import { baseProcedure, createTRPCRouter } from "@/trpc/init";
import { revalidatePath } from "next/cache";
import { z } from "zod";
export default createTRPCRouter({
  revalidatePath: baseProcedure
    .input(
      z.object({
        path: z.string(),
      })
    )
    .mutation(async ({ input }) => {
      console.log("revalidatePath", input.path);
      revalidatePath(input.path);
      return {
        msg: `path:${input.path} 清理缓存成功`,
      };
    }),
});
